define(function(){
    function Ajax(obj){
        Object.assign(this,obj)
        this.init();
    }
    Ajax.prototype={
        constructor:Ajax,
    
        init:function(){
            var xml=new XMLHttpRequest();
    
            xml.open(this.type,this.url,this.async);
    
            xml.send()
            console.log(xml)
            xml.onreadystatechange=()=>{
                if(xml.readyState==4&&xml.status==200){
                    var data=JSON.parse(xml.responseText)
                    this.callBack(data)
                }
            }
        }
    
    }
    return Ajax
})